import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: 'ID',
    dataIndex: 'id',
  },
  {
    title: '产品名称',
    dataIndex: 'commonname',
  },
  {
    title: '单位',
    dataIndex: 'unit',
  },
  {
    title: '规格',
    dataIndex: 'spec',
  },
  {
    title: '批号',
    dataIndex: 'batchnumber',
  },
  {
    title: '生产厂商',
    dataIndex: 'origin',
  },
  {
    title: '备注',
    dataIndex: 'memo',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '产品名称',
    field: 'commonname',
    component: 'Input',
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  { label: '', field: 'id', component: 'Input', show: false },
  {
    label: '产品名称',
    field: 'commonname',
    component: 'Input',
    required: true,
  },
  {
    label: '单位',
    field: 'unit',
    component: 'Input',
    required: true,
  },
  {
    label: '规格',
    field: 'spec',
    component: 'Input',
    required: true,
  },
  {
    label: '批号',
    field: 'batchnumber',
    component: 'Input',
  },
  {
    label: '生产厂商',
    field: 'origin',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'memo',
    component: 'Input',
  },
];
